<?php 

class ConfigController extends Controller{
	private $db;
	public function __init()
	{
		$this->db=K('Config');
	}
	//设置配置
	public function set()
	{
		if (IS_POST) {
			if ($this->db->updateConfig()) {//更新配置
				$this->success('更新成功');//异步默认返回值给js
			}else{
				$this->error($this->db->error);
			}	
		}else{
			//获得配置项
			$data=$this->db->get();
			$this->assign('data',$data);
			$this->display();
		}
	}
}

 ?>